//
//  AutoLayoutUtil.m
//  JuCaiBang
//
//  Created by 陈全 on 15/8/3.
//
//

#import "AutoLayoutUtil.h"

@implementation AutoLayoutUtil

+ (void)autoLayoutWith:(NSArray *)allSubView
{
    [allSubView enumerateObjectsUsingBlock:^(UIView *obj, NSUInteger idx, BOOL *stop) {
        obj.frame = CGRectMake(obj.frame.origin.x*KScr, obj.frame.origin.y*KScr, obj.frame.size.width*KScr, obj.frame.size.height*KScr);
        if ([obj isKindOfClass:[UILabel class]]||[obj isMemberOfClass:[UITextField class]]||[obj isMemberOfClass:[UITextView class]]) {
            UILabel *label = (UILabel *)obj;
            CGFloat size = label.font.pointSize;
            label.font = [UIFont systemFontOfSize:size*KScr];
        }
        if ([obj isKindOfClass:[UIButton class]]) {
            UIButton *btn = (UIButton*)obj;
            UILabel *label = btn.titleLabel;
            CGFloat size = label.font.pointSize;
            label.font = [UIFont systemFontOfSize:size*KScr];
        }
    }];
    
    
}


@end
